package wicket.example.components.table.test.navigator;

import java.io.Serializable;

import org.apache.wicket.util.lang.Objects;

public final class DropDownEntry implements Serializable {

	private static final long serialVersionUID = 1L;

	private final Integer entriesPerPageNumber;
	private final String entriesPerPageTextValue;

	public DropDownEntry(int entriesPerPageNumber,
			String entriesPerPageTextValue) {
		this.entriesPerPageNumber = entriesPerPageNumber;
		this.entriesPerPageTextValue = entriesPerPageTextValue;
	}

	public int getEntriesPerPageNumber() {
		return entriesPerPageNumber;
	}

	public String getEntriesPerPageTextValue() {
		return entriesPerPageTextValue;
	}

	@Override
	public int hashCode() {
		int hashCode = 37;
		if (this.entriesPerPageNumber != null) {
			hashCode ^= 37 * this.entriesPerPageNumber.hashCode();
		}
		if (this.entriesPerPageTextValue != null) {
			hashCode *= 17 / this.getEntriesPerPageTextValue().hashCode();
		}
		return hashCode;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (!(obj.getClass().equals(DropDownEntry.class))) {
			return false;
		}
		DropDownEntry object = (DropDownEntry) obj;
		return Objects.equal(this.entriesPerPageNumber,
				object.entriesPerPageNumber)
				&& Objects.equal(this.entriesPerPageTextValue,
						object.entriesPerPageTextValue);
	}

}
